<template>
	<view :class="currentTheme">
		<a-nabbar name="DM" />
		<mescroll-body  @init="mescrollInit"  @down="downCallback"  @up="upCallback">
			<view class=" u-padding-left-32 u-padding-right-32">
				<template>
					<view class="text-color-DEDEDE u-font-22  u-padding-top-20">
						<item-search placeholder="搜索DM" @change="downCallback" v-model="form.name"></item-search>
					</view>
					<!-- <view class="u-text-center text-color-DEDEDE u-font-22">你还可以创建xx个门店！</view> -->
				</template>
				<view class="u-margin-top-20">
					<view  v-for="(item,index) in dataList" :key="index" class="u-margin-bottom-20">
						<list-item  :showFooterRight="false" :isAvatar="false"  :isShare="false" :item="item"  itemTypeTxt="DM">
							<!-- <view slot="imageFixed" class="img-fixed" v-if="item.storeUserType&&item.id===loginForm.storeId">
								当前门店（{{item.storeUserType}}）
							</view> -->
							<view slot="content">
								<view class="text-color-9598a4 u-font-26 u-margin-top-20">
									已开场次：{{item.openedNum || '0'}}
								</view>
								<view class="text-color-9598a4 u-font-26 u-margin-top-20 address">
									Ta会开的本： {{item.dmName || '暂无'}}
								</view>
							</view>
						</list-item>
					</view>
				</view>
			</view>
		</mescroll-body>
	</view>
</template>

<script>
	import upCallback from '@/mixins/upCallbackMixin.js'
	import {deleteIds,add} from '@/api/crud.js'
	import model from '@/components/u-modal/u-modal.vue'
	import itemSearch from '@/components/itemSearch/itemSearch.vue'
	export default {
		mixins:[upCallback],
		components: {
			model,itemSearch
		},
		data() {
			return {
				dataList:[],
				apiModule:'shopApi',
				apiType:'systemStoreUser',
				value:'',
				form:{
					name:'',
          storeId:'',
          clerkType:'DM',
          uid:null
				},
				timer:null,
				option:{},
				modalFlag:false
			}
		},
		onLoad(option) {
			this.option = option;
      this.form.storeId = option.id
		},
    // updated() {

    // },
		computed: {

		},
		methods: {
      dataListCallBack(res){
        console.log(res,'res');
        this.dataList = res.content.map(t => {
        t.user.categoryDescription = t.personalLabel 
        t.user.dmName = t.storeProducts.map(i=>`《${i.name}》`).join(' ')
        t.user.image = t.user.avatar
        t.user.openedNum = t.openedNum
        return t.user
      }) || []
      }
		}
	}
</script>

<style lang="scss" scoped>
	.fixed{
		&-empty{
			height: 200rpx;
		}
		&-btn{
			position: fixed;
			bottom: 0;
			left: 0;
			right: 0;
			.add-person{
				margin: 30rpx;
				border-radius: 50rpx;
				line-height:88rpx ;
				text-align: center;
				color:white ;
				font-size: 34rpx;
				background-color: #765CFE;
			}
		}
	}
	.address{
		line-height: 40rpx;
	}
	.img-fixed{
		position: absolute;
		left: 0;
		top: 0;
		border-radius: 20rpx 0  20rpx 0 ;
		background-color: $primary;
		font-size: 24rpx;
		color: white;
		padding:10rpx 15rpx;
	}
</style>
